import { UploadOutlined } from "@ant-design/icons";
import ProForm, { DrawerForm, ProFormDatePicker, ProFormGroup, ProFormSelect, ProFormText, ProFormTextArea } from "@ant-design/pro-form"
import { PageContainer } from "@ant-design/pro-layout"
import ProTable, { ProColumns } from "@ant-design/pro-table"
import { Button, Upload } from "antd";
import { useState } from "react";

export default () => {
  const [activeKey,setActiveKey] = useState("tab1");
  const [showDetail,setShowDetail] = useState(false);
  const [fileList,setFileList] =useState<any>([]);


  const columns:ProColumns[] = [
    {
      title:'主题',
      dataIndex: 'name',
      // width:150,
      ellipsis:true,
      renderText:()=>'人民医院产品招标'
    },
    {
      title:'省份',
      dataIndex: 'name1',
      renderText:()=>'江苏省'
    },
    {
      title:'平台开放期（起）',
      dataIndex: 'name2',
      hideInSearch:true,
      width:130,
      ellipsis:true,
      renderText:()=>'2022-12-01'
    },
    {
      title:'平台开放期（止）',
      dataIndex: 'name3',
      hideInSearch:true,
      width:130,
      renderText:()=>'2022-12-31'
    },
    {
      title:'挂网要求及流程',
      hideInSearch:true,
      dataIndex: 'name7',
      width:150,
      ellipsis:true,
      renderText:()=>'暂无'
    },

    {
      title:'业务类型',
      hideInSearch:true,
      width:100,
      ellipsis:true,
      dataIndex: 'name4',
      valueType:'select',
      valueEnum:{
        '1':'类型1',
        '2':'类型2',
      },
      renderText:()=>'进行中'
    },
    {
      title:'所有人',
      dataIndex: 'name73',
      width:100,
      renderText:()=>'王五'
    },
    {
      title:'创建日期',
      dataIndex: 'name7in8',
      width:100,
      hideInSearch:true,
      renderText:()=>'2022-12-11'
    },
    {
      title: '规格型号',
      dataIndex: 'n1',
      renderText:()=>'CP212202'
    },
    {
      title: '产品名称',
      dataIndex: 'n1',
      renderText:()=>'显微镜'
    },
    {
      title: '国家医保耗材编码（27位）',
      dataIndex: 'n3',
      width:200,
      ellipsis:true,
      renderText:()=>'--'
    },
    {
      title: 'UDI码',
      dataIndex: 'n4',
      hideInSearch:true,
      renderText:()=>'--'
    },
    {
      title: '收费编码/物价编码',
      dataIndex: 'n3',
      renderText:()=>'--'
    },
    {
      title: '挂网状态',
      hideInSearch:true,
      dataIndex: 'n3',
      valueType:'select',
      valueEnum:{
        1:'待挂网'
      },
      renderText:()=>'待挂网'
    },
    {
      title: '挂网情况说明',
      hideInSearch:true,
      dataIndex: 'n3',
      renderText:()=>'--'
    },
    {
      title: '挂网价格',
      dataIndex: 'n3',
      hideInSearch:true,
      renderText:()=>'--'
    },
    {
      title: '是否可收费',
      dataIndex: 'n3',
      valueType:'select',
      valueEnum:{
        1:'可收费'
      },
      renderText:()=>'可收费'
    },
    {
      title: '是否医保支付',
      dataIndex: 'n3',
      renderText:()=>'甲类',
      valueType:'select',
      valueEnum:{
        1:'甲类',
        2:'乙类'
      },
    },
    {
      title: '医保支付比例',
      dataIndex: 'n3',
      hideInSearch:true,
      renderText:()=>''
    },
    {
      title: '收费依据',
      hideInSearch:true,
      dataIndex: 'n3',
      renderText:()=>''
    },
  ]

  return (
    <PageContainer>
           <ProTable
      headerTitle=''
      scroll={{x:3000}}
      search={{span:6,
        collapseRender:false,
        optionRender: ({ searchText, resetText }, { form }) => [
              <Button
                key='search'
                type='primary'
                onClick={() => {
                  form?.submit();
                }}
              >
                {searchText}
              </Button>,
              <Button
                key='rest'
                onClick={() => {
                  form?.resetFields();
                  form?.submit();
                }}
              >
                {resetText}
              </Button>,
              <Button key='out' onClick={async()=>{
               
              }}>导出</Button>,
            ],
          
        }}
      pagination={{
        pageSizeOptions:['20', '100', '500']
      }}
      toolBarRender={() => [
        ]
        }
     dataSource={[{}]}
      columns={columns}
      rowKey="id"
      toolbar={{
        menu: {
          type: 'tab',
          activeKey: activeKey,
          items: [
            {
              key: 'tab1',
              label: <span>全部</span>,
            },
            {
              key: 'tab2',
              label: <span>我负责的</span>,
            },
            {
              key: 'tab5',
              label: <span>我参与的</span>,
            }
          ],
          onChange: (key) => {
            setActiveKey(key as string);
          },
        },
        settings: [],
      }}
      />
    </PageContainer>)
}